﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Data.SqlClient;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using DevExpress.XtraEditors;

namespace gpao2012
{
    public partial class listedesgrillesdetailles : DevExpress.XtraEditors.XtraUserControl
    {
        public listedesgrillesdetailles()
        {
            InitializeComponent();
        }

        private void listedesgrillesdetailles_Load(object sender, EventArgs e)
        {
            // TODO: This line of code loads data into the 'gpaogscofficielDataSet.detail_taille' table. You can move, or remove it, as needed.
            this.detail_tailleTableAdapter.Fill(this.gpaogscofficielDataSet.detail_taille);
            // TODO: This line of code loads data into the 'gpaogscofficielDataSet.taille' table. You can move, or remove it, as needed.
            this.tailleTableAdapter.Fill(this.gpaogscofficielDataSet.taille);
            // TODO: This line of code loads data into the 'gpaogscofficielDataSet.taille' table. You can move, or remove it, as needed.
            this.tailleTableAdapter.Fill(this.gpaogscofficielDataSet.taille);
            this.barstatustext.ForeColor = System.Drawing.Color.Black;
           
        }

        private void comboBoxEdit1_EditValueChanged(object sender, EventArgs e)
        {
            //var ds = new DataSet(); 
            //SqlConnection con = new SqlConnection(@"Data Source=.\SQLEXPRESS;Initial Catalog=gpaogscofficiel;Integrated Security=True");
            //con.Open();
            //SqlDataAdapter adp = new SqlDataAdapter("SELECT detail_taille.id_det_gr, detail_taille.taille, detail_taille.id_taille FROM detail_taille  WHERE detail_taille.id_taille ="+colcode.VisibleIndex.ToString(), con); 
            //adp.Fill(ds);
            //DataTable dt = ds.Tables[0];
            //gridControl2.DataSource = dt;       
            //con.Close();
        }

        private void simpleButton2_Click(object sender, EventArgs e)
        {
            try
            {
                this.Validate();
                this.tailleBindingSource1.EndEdit();
                this.tailleTableAdapter.Update(this.gpaogscofficielDataSet.taille);
                this.barstatustext.ForeColor = System.Drawing.Color.Lime;
                barstatustext.Text = "Enregistrement éffectué";

            }
            catch (System.Exception ex)
            {
                this.barstatustext.ForeColor = System.Drawing.Color.Red;
                barstatustext.Text = "Erreur";
            }
        }

    
       

        

      

        

      

        
    }
}